import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 活动任务详情信息 */
export interface ActivityTask {
          id: number; // 任务ID
          requestId?: string; // 请求的唯一ID
          code?: string; // 状态码
          message?: string; // 返回的消息
          batchId?: string; // 批次ID
          importNum?: number; // 导入的记录数量
          marketingTool: string; // 任务执行平台
  }

// 活动任务详情 API
export const ActivityTaskApi = {
  // 查询活动任务详情分页
  getActivityTaskPage: async (params: any) => {
    return await request.get({ url: `/vos/activity-task/page`, params })
  },

  // 查询活动任务详情详情
  getActivityTask: async (id: number) => {
    return await request.get({ url: `/vos/activity-task/get?id=` + id })
  },

  // 新增活动任务详情
  createActivityTask: async (data: ActivityTask) => {
    return await request.post({ url: `/vos/activity-task/create`, data })
  },

  // 修改活动任务详情
  updateActivityTask: async (data: ActivityTask) => {
    return await request.put({ url: `/vos/activity-task/update`, data })
  },

  // 删除活动任务详情
  deleteActivityTask: async (id: number) => {
    return await request.delete({ url: `/vos/activity-task/delete?id=` + id })
  },

  /** 批量删除活动任务详情 */
  deleteActivityTaskList: async (ids: number[]) => {
    return await request.delete({ url: `/vos/activity-task/delete-list?ids=${ids.join(',')}` })
  },

  // 导出活动任务详情 Excel
  exportActivityTask: async (params) => {
    return await request.download({ url: `/vos/activity-task/export-excel`, params })
  },
}